[QNN EP] Bug fix: multiple consumer for cast result in name conflicts#25584
Merged
HectorSVC merged 3 commits intomicrosoft:mainfrom Aug 1, 2025
Merged
[QNN EP] Bug fix: multiple consumer for cast result in name conflicts#25584HectorSVC merged 3 commits intomicrosoft:mainfrom
HectorSVC merged 3 commits intomicrosoft:mainfrom
Conversation
57dcbc0 to
25504e8
Compare
25504e8 to
ea0df77
Compare
Contributor
|
/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline,Windows x64 QNN CI Pipeline |
|
Azure Pipelines successfully started running 5 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug in the QNN EP where multiple consumers of the same cast node for Gather indices caused name conflicts. The fix conditionally skips adding cast nodes and tensors when they already exist.
Key changes:
- Removed the centralized
AddInt64CastNodemethod to allow for more context-aware cast handling - Added conditional checks to prevent duplicate tensor and node creation
- Standardized QNN operation names to use constants instead of string literals
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| qnn_model_wrapper.h | Removes the centralized AddInt64CastNode method |
| gather_op_builder.cc | Implements inline cast handling with duplicate prevention logic and fixes function name typo |
| transpose_op_builder.cc | Updates cast operation to use QNN_OP_CAST constant |
| topk.cc | Updates cast operation to use QNN_OP_CAST constant |
| base_op_builder.cc | Updates cast operation to use QNN_OP_CAST constant |
onnxruntime/core/providers/qnn/builder/opbuilder/gather_op_builder.cc
Outdated
Show resolved
Hide resolved
…lder.cc Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
qti-yuduo
commented
Jul 31, 2025
Contributor
|
/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline,Windows x64 QNN CI Pipeline |
|
Azure Pipelines successfully started running 5 pipeline(s). |
HectorSVC
approved these changes
Aug 1, 2025
sanketkaleoss
pushed a commit
to sanketkaleoss/onnxruntime
that referenced
this pull request
Aug 11, 2025
…microsoft#25584) Bug fix for QNN EP when multiple consumer of same cast node inserted for Gather indices. Now conditionally skip adding the node when already happen.
gedoensmax
pushed a commit
to gedoensmax/onnxruntime
that referenced
this pull request
Sep 2, 2025
…microsoft#25584) Bug fix for QNN EP when multiple consumer of same cast node inserted for Gather indices. Now conditionally skip adding the node when already happen.
qti-yuduo
pushed a commit
to CodeLinaro/onnxruntime
that referenced
this pull request
Sep 24, 2025
- pick microsoft#25584 - pick microsoft#25635 - pick microsoft#25673 - pick microsoft#25702 - pick microsoft#25738
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug fix for QNN EP when multiple consumer of same cast node inserted for Gather indices. Now conditionally skip adding the node when already happen.